﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Catalogit
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
            LoadSettings();
        }

        private void btnBrowseMoviePath_Click(object sender, EventArgs e)
        {
            if(fbdMoviePath.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                txtMoviePath.Text = fbdMoviePath.SelectedPath;
            }
            
        }

        private void btnBrowseVLCPath_Click(object sender, EventArgs e)
        {
            if(fbdVLCPath.ShowDialog() == DialogResult.OK)
            {
                txtVLCPath.Text = fbdVLCPath.SelectedPath;
            }
        }

        private void btnSaveSettings_Click(object sender, EventArgs e)
        {
            Properties.Settings.Default.MoviePath = txtMoviePath.Text;
            Properties.Settings.Default.VLCPath = txtVLCPath.Text;
            Properties.Settings.Default.Save();

            this.Close();

        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void LoadSettings()
        {
            txtMoviePath.Text = Properties.Settings.Default.MoviePath;
            txtVLCPath.Text = Properties.Settings.Default.VLCPath;
        }


    }
}
